package com.sunyard.pcc.shiro.interceptor;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @Author: Hewei
 * @Description: shiro拦截器配置器
 * @Date: Created in 14:51 2018/3/1
 */
@Slf4j
@Configuration
public class ShiroAuthConfigurerAdapter extends WebMvcConfigurerAdapter {

    @Autowired
    private ShiroAuthInterceptor shiroAuthInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(shiroAuthInterceptor).addPathPatterns("/**");
    }
}
